Skip to content

Introduce #[diagnostic::on_move(message)]#150935

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
rperier:provide_diagnostic_on_move_for_smart_pointers
Mar 20, 2026
Merged

Introduce #[diagnostic::on_move(message)]#150935
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
rperier:provide_diagnostic_on_move_for_smart_pointers

Conversation

@rperier
Copy link
Copy Markdown
Contributor

@rperier rperier commented Jan 10, 2026

View all comments

cc #149862

This is a first proposal. I have deliberately kept it simpler than diagnostic::on_unimplemented.

Few questions/remarks:

  • Do I need to move the OnMoveDirective logic into a dedicated module perhaps ? let's say into compiler/rustc_borrowck/src/diagnostics/on_move.rs
  • No problems to depend on crates like rustc_ast from the borrowck ?
  • Notes are not supported yet. While message and label are very static , in the sense that they are emitted in the same way from the same place in the borrowck, it is not the case for the notes. It would make the code more complex. But, I can add support for notes if it does make sense.

Suggestions are welcomed !

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants